package myJs.myPkg

import jsext._

import scala.scalajs.js
import scala.language.implicitConversions
import scala.scalajs.js.JSConverters._
import jquery.JQuery


/**
 * Created by yz on 2019/3/14
 */
@js.native
trait MiniColorsJQuery extends js.Object {

  def minicolors(options: MiniColorsOptions): JQuery = scalajs.js.native

  def minicolors(method: String,data:js.Dictionary[String]): JQuery = scalajs.js.native

}

object MiniColorsOptions extends MiniColorsOptionsBuilder(noOpts)

class MiniColorsOptionsBuilder(val dict: OptMap) extends JSOptionBuilder[MiniColorsOptions, MiniColorsOptionsBuilder](new MiniColorsOptionsBuilder(_)) {

  def control(v:String)=jsOpt("control", v)

  def defaultValue(v:String)=jsOpt("defaultValue", v)

  def format(v:String)=jsOpt("format", v)

  def keywords(v:String)=jsOpt("keywords", v)

  def inline(v:Boolean)=jsOpt("inline", v)

  def letterCase(v:String)=jsOpt("letterCase", v)

  def opacity(v:Boolean)=jsOpt("opacity", v)

  def position(v:String)=jsOpt("position", v)

  def swatches(v:js.Array[String])=jsOpt("swatches", v)

  def theme(v:String)=jsOpt("theme", v)

  def change(v:js.Function)=jsOpt("change", v)

}

trait MiniColorsOptions extends js.Object {

}

trait MiniColorsJQueryImplicits {
  implicit def implicitMiniColorsJQuery(jq: JQuery): MiniColorsJQuery = {
    jq.asInstanceOf[MiniColorsJQuery]
  }
}
